﻿@model S4Store.Models.AfterSaleReport.AfterSaleSellerDecoratingReportModel
@{
    ViewBag.Title = "CarBrandDecoratingSaleKPI";
    Layout = null;
}

@{
    var config = Model.MonthConfig.FirstOrDefault();
    var daydata = Model.DayData;
 }

 @Html.Action("ReportBar", "Common", Model.BarModel)

 @if(config==null){
     
     <p>数据未配置（月初）</p>
         
 }else
 {
<div style="height: 100%; overflow: auto">
<div class="pagetitle">
    @(config.Employee.Name)服务顾问养护产品过程KPI
</div>
<table width="100%" border="0" cellpadding="10" cellspacing="1" class="reporttable">
  <tr>
    <th align="center"><div>售后前台接待姓名</div></th>
    <th align="center" class="tb_header_greenbg"><div>接待前台职业资质</div></th>
    <th align="center"  class="tb_header_greenbg"><div>养护产品目标销售额[万]</div></th>
    <th align="center"  class="tb_header_greenbg"><div>累计入台次厂</div></th>
    <th align="center"  class="tb_header_greenbg"><div>累计养护产品销售额</div></th>
    <th align="center"  class="tb_header_greenbg"><div>养护产品销售完成率</div></th>
    <th align="center"  class="tb_header_greenbg"><div>单车养护产品销售额[元]</div></th>
  </tr>
  <tr>
    <td>@config.Employee.Name </td>
    <td>@config.Employee.WorkYear 年</td>
    <td>@config.YHCPMBXSE_MaintenceSaleTarget</td>

    <td>@daydata.Sum(o=>o.SGRCTC_AccidentToFactory+o.WXRCTC_MaintentceToFactory)</td>
    <td>@daydata.Sum(o=>o.LJYHCPXSE)</td>
    @{
     var 养护产品销售完成率 = config.YHCPMBXSE_MaintenceSaleTarget == 0 ? 0 : daydata.Sum(o => o.LJYHCPXSE) / config.YHCPMBXSE_MaintenceSaleTarget;
    }
    <td>@Math.Round(养护产品销售完成率*100,0,MidpointRounding.AwayFromZero)</td>
    

    <td>@Math.Round((daydata.Sum(o => o.SGRCTC_AccidentToFactory + o.WXRCTC_MaintentceToFactory)==0?0:daydata.Sum(o => o.LJYHCPXSE)/(decimal)(daydata.Sum(o=>o.SGRCTC_AccidentToFactory+o.WXRCTC_MaintentceToFactory))*10000),0)</td>

  </tr>
</table>
</div>
}